package cn.jeefast.rest.controller;


import cn.jeefast.common.entity.MbProj;
import cn.jeefast.common.utils.R;
import cn.jeefast.rest.annotation.AuthIgnore;
import cn.jeefast.rest.service.MbProjService;
import cn.jeefast.rest.service.impl.MbProjServiceImpl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.google.j2objc.annotations.AutoreleasePool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author theodo
 * @since 2019-12-30
 */
@RestController
@RequestMapping("/api")
public class MbProjController {

    @Autowired
    private MbProjService projService;

    @RequestMapping("/proj/list")
    @AuthIgnore
	public R projList(){
        EntityWrapper ew = new EntityWrapper();
        List list = projService.selectList(ew);
        return R.ok("").put("data",list);
    }

    /**
     * 项目介绍
     * @return
     */
    @RequestMapping("/proj/text")
    public R projText(Long projId){
        MbProj mbProj = projService.selectById(projId);
        return R.ok("").put("data",mbProj.getProjIntroduce());
    }

    @RequestMapping("/proj/agreement")
    @AuthIgnore
    @CrossOrigin
    public R agreement(){
        MbProj mbProj = projService.selectById(11);
        return R.ok().put("data",mbProj.getProjAgreement());
    }
}
